package com.zcyr.core;

import com.zcyr.exception.DatabaseEnvironmentManagerException;

/**
 * 面向用户的IDatabaseEnvironmentManager接口
 */
public interface IDatabaseEnvironmentManager {

    /**
     * 获取自身在使用的数据库环境
     * @param uuid 环境id
     * @return IDatabaseEnvironment
     */
    IDatabaseEnvironment getEnvironment(String uuid);

    /**
     * 获取或创建可用的数据库环境
     * @return IDatabaseEnvironment
     */
    IDatabaseEnvironment getAvailableEnvironment() throws DatabaseEnvironmentManagerException;

    /**
     * 释放数据库环境的资源
     * @param uuid 环境id
     * @throws DatabaseEnvironmentManagerException 如果失败则抛出该异常
     */
    void releaseDatabaseEnvironment(String uuid) throws DatabaseEnvironmentManagerException;
}
